Skip to content

feat(git): resolve exact two-dot and three-dot ranges - #27

Merged
nia-sg-bot merged 1 commit into
mainfrom
nia/issue-21-commit-ranges
Aug 15, 2026
Merged

feat(git): resolve exact two-dot and three-dot ranges#27
nia-sg-bot merged 1 commit into
mainfrom
nia/issue-21-commit-ranges

Conversation

@nia-sg-bot

@nia-sg-bot nia-sg-bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • resolve two-dot comparisons from immutable base/head commit OIDs
  • resolve three-dot comparisons from the immutable merge base to head, matching Git semantics
  • preserve requested refs alongside exact base, head, and comparison-base object IDs
  • return structured warnings for invalid refs and unrelated histories instead of false changes
  • retain caller-relative pathspec scoping for commit ranges

Verification

  • python3 -m pytest -q tests/test_git_snapshot.py — 15 passed
  • python3 -m pytest -q — 107 passed
  • python3 -m compileall -q diffgraph tests mcp_server.py build.py
  • git diff --check

Compatibility

This adds an internal resolver without changing the current CLI, schema, or extension contract. No cross-repository compatibility or public-claim updates are required for this slice.

Remaining work

Wire commit-range resolution into the canonical artifact/CLI path and carry these immutable endpoint identities into artifact provenance. The broader edge-case matrix in #21 remains open.

Part of #21

Summary by CodeRabbit

  • New Features

    • Added support for comparing immutable commit ranges using two-dot and three-dot modes.
    • Commit comparisons now resolve exact endpoint commits and merge bases.
    • Added optional path filtering for scoped comparisons.
    • Results include structured comparison details and warnings.
  • Bug Fixes

    • Invalid references or unavailable merge bases now produce clear warnings instead of misleading diff entries.

@nia-sg-bot nia-sg-bot added roadmap Tracked on the public WildestAI roadmap priority:P0 Critical path / blocks a usable product direction:aligned Aligned with the current WildestAI product direction labels Aug 15, 2026
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dfb803d6-a855-4c68-b4d7-0f7c6c9143bf

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6b483 and 477d716.

📒 Files selected for processing (2)
  • diffgraph/git_snapshot.py
  • tests/test_git_snapshot.py

Walkthrough

Adds immutable two-dot and three-dot commit-range snapshots. The implementation resolves exact commit identities, applies scoped raw diffs, and reports structured warnings for invalid references or missing merge bases.

Changes

Commit-range snapshot resolution

Layer / File(s) Summary
Commit-range model, resolution, and validation
diffgraph/git_snapshot.py, tests/test_git_snapshot.py
Adds CommitRangeResolution and resolve_commit_range. The implementation resolves commit and merge-base object IDs, parses scoped diffs, sorts entries, and returns structured warnings. Tests cover two-dot and three-dot comparisons, pathspecs, invalid references, endpoint identities, and missing merge bases.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 477d7

This PR adds localized Git range resolution with passing verification and no actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant resolve_commit_range
  participant _resolve_commit
  participant Git
  participant CommitRangeResolution
  Caller->>resolve_commit_range: base_ref, head_ref, three_dot, pathspecs
  resolve_commit_range->>_resolve_commit: resolve base and head commits
  _resolve_commit->>Git: verify refs and object IDs
  Git-->>_resolve_commit: commit object IDs
  resolve_commit_range->>Git: resolve merge base when three_dot is enabled
  Git-->>resolve_commit_range: comparison base object ID
  resolve_commit_range->>Git: execute scoped raw diff
  Git-->>resolve_commit_range: raw diff records
  resolve_commit_range->>CommitRangeResolution: entries, IDs, and warnings
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exact two-dot and three-dot Git range resolution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nia/issue-21-commit-ranges

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nia-sg-bot

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nia-sg-bot
nia-sg-bot merged commit 06098d5 into main Aug 15, 2026
4 checks passed
@nia-sg-bot
nia-sg-bot deleted the nia/issue-21-commit-ranges branch August 15, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

direction:aligned Aligned with the current WildestAI product direction priority:P0 Critical path / blocks a usable product roadmap Tracked on the public WildestAI roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant